package com.itheima.HomeWork_day07;

import java.time.Duration;
import java.time.LocalDateTime;

public class DurationTest07 {

    public static void main(String[] args) {

        LocalDateTime localDateTime1 = LocalDateTime.of(2020, 1, 1, 13, 14, 15);
        LocalDateTime localDateTime2 = LocalDateTime.of(2020, 1, 2, 11, 12, 13);

        Duration duration = Duration.between(localDateTime1, localDateTime2);
        System.out.println(duration);

        //获得此时间间隔的秒
        System.out.println(duration.getSeconds());

        //获得此时间隔的毫秒
        long millis = duration.toMillis();
        System.out.println(millis);


    }
}
